package com.example.springbootemployees.Dao;

import com.example.springbootemployees.pojo.Department;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
@Repository
@Mapper
public interface DepartmentMapper {
    @Select("select*from department")
    List<Department> getAllDepartment();
    @Select("select * from department where id=#{id}")
    Department getDepartmentById(@Param("id") int id);
    @Insert("insert into department(departmentName) values(#{departmentName})")
    int addDepartment(Department department);
    @Delete("delete from department where id=#{id}")
    int delDepartmentById(@Param("id") int id);
    @Update("update department set departmentName=#{departmentName} where id=#{id}")
    int updDepartment(Department department);
}
